/**
 * @file implements ManifestLoader
 * @author CORSAIR <vladimir.corsair@gmail.com>
 * @returns {undefined}
 */
var ManifestLoader = function() {};

ManifestLoader.prototype.load = function(callback) {
    var self = this;
    var xmlhttp;

    if (!window.XMLHttpRequest)
        return false;

    xmlhttp = new XMLHttpRequest();

    xmlhttp.onreadystatechange = function() {
        if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
            callback.call(self, JSON.parse(xmlhttp.responseText));
        }
    };

    var filename = "../manifest.json";

    xmlhttp.open("GET", filename, true);
    xmlhttp.send();
};